java jcombobox itemlistener only if value changed

114

java jcombobox itemlistener only if value changed -

comboBox.addItemListener(new ItemListener() {
	@Override
    public void itemStateChanged(ItemEvent e) {
      if(e.getStateChange() == ItemEvent.SELECTED) { // Check if the value got selected, ignore if it has been deselected
        //Do stuff
      }
    }
});

Comments

Submit
0 Comments